package com.shop.entity;

import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;

/**
 * Comment entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "comment", catalog = "myshop")
public class Comment implements java.io.Serializable {

	// Fields

	private Integer ecId;
	private User user;
	private String ecContent;
	private Timestamp ecCreateTime;
	private String ecReply;
	private Timestamp ecReplyTime;
	private String ecNikeName;

	// Constructors

	/** default constructor */
	public Comment() {
	}

	/** full constructor */
	public Comment(User user, String ecContent, Timestamp ecCreateTime,
			String ecReply, Timestamp ecReplyTime, String ecNikeName) {
		this.user = user;
		this.ecContent = ecContent;
		this.ecCreateTime = ecCreateTime;
		this.ecReply = ecReply;
		this.ecReplyTime = ecReplyTime;
		this.ecNikeName = ecNikeName;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "ec_id", unique = true, nullable = false)
	public Integer getEcId() {
		return this.ecId;
	}

	public void setEcId(Integer ecId) {
		this.ecId = ecId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user_id")
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "ec_content", length = 200)
	public String getEcContent() {
		return this.ecContent;
	}

	public void setEcContent(String ecContent) {
		this.ecContent = ecContent;
	}

	@Column(name = "ec_create_time", length = 19)
	public Timestamp getEcCreateTime() {
		return this.ecCreateTime;
	}

	public void setEcCreateTime(Timestamp ecCreateTime) {
		this.ecCreateTime = ecCreateTime;
	}

	@Column(name = "ec_reply", length = 200)
	public String getEcReply() {
		return this.ecReply;
	}

	public void setEcReply(String ecReply) {
		this.ecReply = ecReply;
	}

	@Column(name = "ec_reply_time", length = 19)
	public Timestamp getEcReplyTime() {
		return this.ecReplyTime;
	}

	public void setEcReplyTime(Timestamp ecReplyTime) {
		this.ecReplyTime = ecReplyTime;
	}

	@Column(name = "ec_nike_name", length = 10)
	public String getEcNikeName() {
		return this.ecNikeName;
	}

	public void setEcNikeName(String ecNikeName) {
		this.ecNikeName = ecNikeName;
	}

}